<?php
session_start();
include_once 'recursos/config.php';
$conf = new configuracion();
$dominio = $conf->getG2uDominio()."/";

?>
<img class="close" src="<?=$dominio?>images/gallery/close.gif" onclick="closePhotoPreview();" />

<div class="pleft">
    <img src="<?=$dominio?><?=$_SESSION["dataWishList"][$_REQUEST["pid"]]["imgFull"]?>" />
</div>

<div class="pright">
    <div class="wlpInfo" id="wlpInfo">
        <table style="background-color:#d6d6d6; width: 100%; padding-top: 10px;" > 
            <tr>
               <td><img src="<?=$dominio?><?=$_SESSION["dataUser"]["g2uProfilePic"]?>" /></td>
               <td align="left">
                   <b><?=$_SESSION["dataUser"]["g2uFirstName"]." ".$_SESSION["dataUser"]["g2uLastName"]?></b> 
                   <br/> 
                   <?=$_SESSION["dataWishList"][$_REQUEST["pid"]]["desc"]?>
                   
                   <? if($_SESSION["dataUser"]["g2uId"] == $_SESSION["g2uId"]){ ?>
                   <br/><br/>
                   <span id="wlpDeletePhoto" ><img src="<?=$dominio?>images/png/delete.png" /></span>
                   <br/><br/>
                   <? } ?>
               </td>
            </tr>
        </table>
        <table style="background-color:#d6d6d6; width: 100%; padding-left: 5px;" cellspacing="0" cellpadding="2" >
            <tr>
                <td width="50%">
                    <div id="c_cont">
                        <span title="" alt=""> </span> 
                    </div>
                </td>
                <td>
                    <div id="l_cont">
                        <span title="" alt="" ></span> 
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    &bullet;
                   <span id="wishHeadComment">Comentar</span>
                </td>
                <td>
                    &bullet;
                   <span id="wishHeadLike">
                       <? include_once 'vista/vista.wishlist_photo_like.php'; ?>
                   </span>
                </td>
            </tr>
        </table>
        <script>
           $("#wlpInfoExit").click(function(){
               closePhotoPreview();
           });
           $('#photo_preview img.close').click(function (event) {
               closePhotoPreview();
           });
           
           $("#wlpDeletePhoto").click(function(){
              if(confirm("Esta seguro de borrar esta foto?")){
                  $.post('deletePhoto', {view: "wl" , id: <?=$_REQUEST["pid"]?> }, function(data){
                   closePhotoPreview();
                   loadWishList();
                });
              } else {
                return false;
              }
           });
           
           $("#wishHeadComment").click(function(){
               $('#formComment').toggle(1200);
               $('#text').focus();
           });
           
           $("#wishHeadLike").click(function(){
               $.post('sendUserPhotoLike', { id: <?=$_REQUEST["pid"]?> }, function(data){
                   $("#wishHeadLike").html(data);
                });
           });
              
           $('span').tipsy({html: true });
        </script>
    </div>
    
    <div class="comments" id="comments" style="border-color: lightgrey; border-style: solid; border-width: 0.5em"> 
        <input type="hidden" name="img" value="<?=$_REQUEST["id"]?>" id="img" />
        <form onsubmit="return false;" style="display:none;" id="formComment"> 
            <table> 
                <tr>
                   <td class="field">
                       <textarea name="text" id="text"></textarea>
                   </td>
                   <td class="field">
                       <input type="button" onclick="submitComment('<?=$_REQUEST["pid"]?>','<?=$_REQUEST["id"]?>');" value="Comentar!" />
                   </td>
               </tr>
            </table> 
        </form> 
        <div id="comments_list">
            <?php
            include_once 'vista/vista.wishlist_photo_comments.php';
            ?>
        </div> 
    </div>
    
    <div>
    <!-- Others Imgs -->
    </div>
</div>